//
//  ZGLAddOptionsCell.m
//  Faker
//
//  Created by dllo on 15/10/29.
//  Copyright © 2015年 dllo. All rights reserved.
//

#import "ZGLAddOptionsCell.h"

@interface ZGLAddOptionsCell ()

@property (nonatomic, strong) UIImageView *optionView;

@property (nonatomic, strong) UILabel *lineLabel;
@property (nonatomic, strong) UILabel *linnsLabel;


@end


@implementation ZGLAddOptionsCell


- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        self.optionView = [[UIImageView alloc] init];
        self.titleLabel = [[UILabel alloc] init];
        self.lineLabel = [[UILabel alloc] init];
        self.linnsLabel = [[UILabel alloc] init];
        [self.contentView addSubview:self.titleLabel];
        [self.contentView addSubview:self.optionView];
        [self.contentView addSubview:self.linnsLabel];
        [self.contentView addSubview:self.lineLabel];
    }
    return self;
}

- (void)applyLayoutAttributes:(UICollectionViewLayoutAttributes *)layoutAttributes {
    [super applyLayoutAttributes:layoutAttributes];
    [self.optionView setFrame:CGRectMake(layoutAttributes.frame.size.width / 3, layoutAttributes.frame.size.height / 4, layoutAttributes.frame.size.width / 3, layoutAttributes.frame.size.height / 4)];
    [self.titleLabel setFrame:CGRectMake(layoutAttributes.frame.size.width / 4, layoutAttributes.frame.size.height * 2 / 3, layoutAttributes.frame.size.width / 2, ScaleY * 20)];
    [self.lineLabel setFrame:CGRectMake(ScaleX * 124.7, 0, ScaleX * 0.3, ScaleY * 125)];
    [self.linnsLabel setFrame:CGRectMake(0, ScaleY * 124.7, ScaleX * 125, ScaleY * 0.3)];
    self.linnsLabel.backgroundColor = [UIColor lightGrayColor];
    self.lineLabel.backgroundColor = [UIColor lightGrayColor];
    [self.optionView setImage:[UIImage imageNamed:@"tianjia"]];
    self.titleLabel.text = @"添加更多";
    self.titleLabel.textAlignment = 1;
    [self.titleLabel setFont:[UIFont systemFontOfSize:12]];
}



@end
